<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小鹿线-教师详情页</title>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="./css/Normalize.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <link rel="stylesheet" href="./css/swiper-bundle.min.css">
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/teacherDetail.css">

</head>

<body>
    <div class="container">
        <header>
            <i class="iconfont icon-arrow_left_fat "></i>
            <div class="h-title">
                师资详情
            </div>
        </header>

        <section>
            <div class="detail-img">
            </div>
            <div class="detail-text">
            </div>
        </section>
    </div>
    <script src="./js/zepto.min.js"></script>
    <script src="./js/swiper-bundle.min.js"></script>
    <script src="./js/flexible.js"></script>
    <script src="./js/lazyload.min.js"></script>
    <script>
        $(function () {
            var result = '';
            // 跳转上一页
            $('.icon-arrow_left_fat').click(function () {
                window.history.go(-1);

            })
            // 拿到教师页面传递过来的数据
            var teacher = decodeURI(window.location.href.split('#')[1]);
            // 请求数据
            $.ajax({
                url: `http://39.101.217.150:8075/teachers/list`,
                data: {
                    page: 1,
                    size: 1,
                    name: teacher,

                },
                success: function (data) {
                    var aRecords = data.data.records[0];
                    $('.detail-text').append(`
                    
                    <div class="names">
                        <span>${aRecords.name}</span>
                        <span>${aRecords.createTime}</span>
                    </div>
                    <div class="text">
                        ${aRecords.content}
                    </div>
                    `)
                    $('.detail-img').append(`
                        <img src="${aRecords.imgurl}" alt="教师详情">
                    `)
                }
            })

        })
    </script>
</body>

</html>